package com.davy.gridpoint.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper {
    public static final String tableStr = "gridpoint_db";
    public static final String logStr = "logs";
    public static final String questStr = "quest";
    public static final String LOGS = "create table " + logStr + "(id integer primary key autoincrement,"
            + "username text," + "password text," + "time text," + "longitude text," + "latitude text)";
    public static final String QUEST = "create table " + questStr + "(id integer primary key autoincrement,"
            + "title text," + "name text," + "type integer," + "item text," + "startTime text," + "endTime text," + "mileage text," + "context text)";
    private Context mContext;

    public DatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int vertion) {
        super(context, name, factory, vertion);
        mContext = context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(LOGS);
        db.execSQL(QUEST);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}

